package com.ytzl.bug_project.controller;

import com.ytzl.bug_project.entity.Bug_detail;
import com.ytzl.bug_project.entity.Bug_project;
import com.ytzl.bug_project.service.Bug_detailService;
import com.ytzl.bug_project.service.Bug_projectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.List;

@RestController
@RequestMapping("/bug_detail")
@Api(tags="bug管理")
public class Bug_detailController {
    @Resource
    private Bug_detailService bug_detailService;

    @ApiOperation("查询全部")
    @GetMapping("/query")
    public List<Bug_detail> query(){
        return bug_detailService.query(null);
    }

    @ApiOperation("添加")
    @PostMapping("/insert")
    public int insert(@RequestBody Bug_detail bug_detail){
        return bug_detailService.insert(bug_detail);
    }

    @ApiOperation("删除")
    @DeleteMapping("/delete")
    public int delete(Integer id){
        return bug_detailService.delete(id);
    }

    @ApiOperation("修改")
    @PutMapping("/update")
    public int update(@RequestBody Bug_detail bug_detail){
        return bug_detailService.update(bug_detail);
    }


}
